package ifosup.seb.socket;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Rectangle;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class ihmClient {
	private JFrame frame;
	private JTextArea textAreaUp;
	private JTextArea textAreaDown;
	
	public ihmClient() {
		// TODO Auto-generated constructor stub
		
		frame = new JFrame();
		
		JPanel container = new JPanel();
		JPanel panelUp = new JPanel();
		JPanel panelDown = new JPanel();
		
		textAreaUp = new JTextArea("", 20,30);
		textAreaUp.setLineWrap(true);
		textAreaUp.setEditable(false);
		JScrollPane upScroll = new JScrollPane(textAreaUp);
		upScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);

		panelUp.add(upScroll);
		
		textAreaDown = new JTextArea("", 3,30);
		textAreaDown.setLineWrap(true);
		JScrollPane downScroll = new JScrollPane(textAreaDown);
		upScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
		
		panelDown.add(downScroll);
		
		container.setLayout(new BorderLayout());
		container.add(panelUp, BorderLayout.NORTH);
		container.add(panelDown, BorderLayout.SOUTH);
		frame.add(container);
		
		frame.pack();
		frame.setResizable(false);
		frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
	
	public void setTextAreaUp(JTextArea textAreaUp) {
		this.textAreaUp = textAreaUp;
	}
}
